#!/bin/bash
purge_packages || exit 1
# remove /etc/apt/preferences.d/99bionic-updates which was added when bionic default repositories were added
sudo rm -f /etc/apt/preferences.d/99bionic-updates
# remove deprecated repofilename
sudo rm -f /etc/apt/sources.list.d/firefox-ubuntu.list
# remove repofile if unused
ppa_name="mozillateam/ppa"
case "$__os_id" in
Ubuntu) ppa_dist="$__os_codename" ;;
*)
  case $__os_codename in
  trixie) ppa_dist="noble" ;;
  bookworm) ppa_dist="jammy" ;;
  bullseye) ppa_dist="focal" ;;
  *) ppa_dist="bionic" ;;
  esac
  ;;
esac
remove_repofile_if_unused /etc/apt/sources.list.d/${ppa_name%/*}-ubuntu-${ppa_name#*/}-${ppa_dist}.list
